EMT Practice Test

1. Question Content...


Question List

Question1: Below is a sample document of "orders" collection

Question2: What is the equivalent command in MongoDB for the following SQL query?
SELECT * FROM posts WHERE author like "%john%"

Question3: Which of the following is true of the mechanics of replication in MongoDB? Check all that apply.

Question4: Which of the following are valid json documents? Select all that apply.

Question5: What is the output of the following program?

Question6: You have a replicated cluster with 1 primary, 3 secondary, 1 arbiter. One of the secondary is hidden. What is the replication factor of this replicated cluster?

Question7: Consider the following example document:
{
"_id": Objectld("5360c0a0a655a60674680bbe"),
"user"
"login": "irOn"
"description": "Made of steel"
"date": ISODate("2014-04-30T09:16:45.836Z"),
}
>
and index creation command:
db.users.createlndex( { "user.login": 1, "user.date": -1 }, "mylndex" ) When performing the following query:
db.users.find( { "user.login": /Air.*/ },
{ "user":1, "_id":0 > ).sort( { "user.date":1 > )
which of the following statements correctly describe how MongoDB will handle the query? Check all that apply.

Question8: What does the following query do when performed on the posts collection? db.posts.update({_id:l},{Title:This is post with ID 1"})

Question9: '$set' sets the value of

Question10: The difference between $push and $addToSet is:

Question11: Consider the following document:
> db.c.find()
{ "_id" : 12, b : [ 3, 5, 7, 2, 1, -4, 3, 12 ] }
Which of the following queries on the "c" collection will return only the first five elements of the array in the
"b"
field? E.g.,
Document you want returned by your query:
{ "_id" : 12, "b" : [ 3, 5, 7, 2, 1 ] >

Question12: Which of the following is a valid insert statement in mongodb? Select all valid.

Question13: Consider that you have a collection called population which has fields state and city. Which of the following query will calculate the population grouped by state and city?

Question14: Write the command(s) are correct to enable sharding on a database "testdb" and shard a collection "testCollection" with _id as shard key.

Question15: Which mongodb tools allow us to work with our data in a human readable format?

Question16: Which is the default mode in which the explain() command runs?

Question17: In what format does mongodump creates backup files?

Question18: You are in a sharded cluster. What will you do prior to initiating backup in sharded cluster?

Question19: JSON stands for

Question20: Which format/standard is used by MongoDB internally to store documents?

Question21: What tool do you use to see if you have a problem in the consumption of disk I / 0?

Question22: Which of the following is correct about MongoDB?

Question23: We can insert multiple documents in bulk using which of the following operations:

Question24: What is the output of following two commands in MongoDB: db. posts. insert({n_id":l}) db.posts.insert({"_id":l})

Question25: Which is the correct order (lowest to highest) in which MongoDB compares the BSON types?

Question26: You have the following index on the toys collection:
{
"manufacturer" : 1,
"name" : 1,
"date" : -1
}
Which of the following is able to use the index for the query? Check all that apply.

Question27: Which of the following operator can be used to control the number of items of an array that a query returns?

Question28: MongoDB is a schema-less design.

Question29: Which option can be used with update command so that a new document gets created if no matching document is found based on the query condition?

Question30: Which of the following node is used during election in a replication cluster?

Question31: Which of the following collections stores authentication credentials in MongoDB?

Question32: In which of the following scenarios is sharding not the correct option. Select all that apply.

Question33: You are comparing values of different BSON types in mongodb. You want to compare from lowest to highest.
Which comparison order is used?

Question34: In a sharded replicas set environment with multiple mongos servers, which of the following would decide the mongos failover?

Question35: To add a new user and enable authentication in MongoDB, which of the following steps need be executed?

Question36: Consider the following documents:

You perform the following query;

How many documents will be updated by the query?

Question37: Which of the following is true about aggregation framework?

Question38: What is the on-premise solution having functionality equivalent to cloud manager?

Question39: Which of the following aggregate commands in MongoDB uses a pipeline approach with the goals of improving the aggregation performance?

Question40: Which of the following does MongoDB use to provide High Availability and fault tolerance?

Question41: Consider that our posts collection contains an array field called tags that contains tags that the user enters. {

Which of the following commands will find all the posts that have been tagged as tutorial.

Question42: You perform the following operation in the shell: db.foo.insert( { } ); What gets inserted?

Question43: Which of the following command is used to get all the indexes on a collection?

Question44: Which command can be used to rebuild the indexes on a collection in MongoDB?